package com.neusoft.neu24.nep.controller;

import com.neusoft.neu24.nep.entity.Animal;
import com.neusoft.neu24.nep.entity.CommonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/a")

public class AnimalController {
    @Autowired
    Environment  env;
    @GetMapping("/q/byid/{aid}")
    public CommonResult selectAnimalById(@PathVariable("aid") Integer aid ) {

        log.info("psp-provider  ----  >   获取到端口号：{}",env.getProperty("server.port"));

        Animal animal = new Animal();
        animal.setId(aid);
        return   CommonResult.sucess(animal);
    }
}
